<template>
  <div>
    子
    {{ test }}
    <div v-imgerr>{{ testp }}</div>
    <el-button @click="testClick">按钮</el-button>
    <br>
  </div>
</template>

<script>
export default {
  name: 'Test',
  directives: {
    imgerr: {
      bind(dom, obj, vnode) {
        obj.value = '123'
        obj.hhh = '234'
        // console.log(dom, obj, vnode)
      },
      inserted() {},
      updated() {},
      componentUpdated() {},
      unbind() {}
    }
  },
  props: ['testp'],
  data() {
    return {
      test: '😄'
    }
  },
  beforeCreate() {
    console.log('beforeCreate:')
  },
  created() {
    // this.testClick()
    console.log('created:')
  },
  beforeMount() {
    console.log('beforeMount:')
  },
  mounted() {
    console.log('mounted:')
  },
  beforeUpdate() {
    console.log('beforeUpdate:')
  },
  updated() {
    console.log('updated:')
  },
  beforeDestroy() {
    console.log('beforeDestroy:')
  },
  destroyed() {
    console.log('destroyed:')
  },
  methods: {
    testClick() {
      this.$emit('test22', Date.now())
    }
  }
}
</script>

<style></style>
